import yaml
import csv
class Utils:

    @classmethod
    def load_yaml(cls,path):
        with open(path) as f:
            #safe_load 方法返回的是一个字典,类似于下面这种
            """
            {'app': 
                {'name': 'My Awesome App', 
                'version': '1.5.0',
                'debug': False, 
                'database': {'driver': 'postgresql', 'host': 'db.example.com'}
                }
            }    
            """
            return yaml.safe_load(f)
        
    @classmethod
    def get_csv(cls,path):
        list1 = []
        with open(path) as f:
            c = csv.reader(f)
            for lines in c:
                list1.append(lines)
            else:
                return list1